.section .data
	str1:
		.string "增容成功\n"
	str2:
		.string "增容失败\n"
.equ INCR_SZ,2
.equ PERSON_SIZE,76
.section .text
.global CheckCapacity
.type CheckCapacity,@function
CheckCapacity:
	push %rbp
	mov %rsp,%rbp
	subq $16,%rsp

	mov %rdi,-8(%rbp)	
	mov -8(%rbp),%rbx
#比较容量和大小是否相同		
	movl 8(%rbx),%r8d
	movl 12(%rbx),%r9d
	cmpl %r8d,%r9d
	je 1f
	leaveq
	retq
1:
#调用realloc增容
	movq (%rbx),%rdi
#求增容后的大小
	addl $INCR_SZ,%r9d
	imull $PERSON_SIZE,%r9d
	movl %r9d,%esi
	call realloc			
	test %rax,%rax
	js 2f
	jz 2f
#增容后将data指向新的内存 并增加容量大小
	movq %rax,(%rbx)
	addl $INCR_SZ,8(%rbx)	
	mov $0,%rax
	mov $str1,%rdi
	call printf
	leaveq
	retq
2:
	mov $0,%rax
	mov $str2,%rdi
	call printf
	leaveq
	retq
